//
//  ShowImageVC.m
//  AVFoundationDemo
//
//  Created by zl on 2019/9/10.
//  Copyright © 2019 LG. All rights reserved.
//

#import "ShowImageVC.h"
#import "AVFoundationTool.h"

@interface ShowImageVC ()
@property (strong, nonatomic) UIImageView *imageView;
@end

@implementation ShowImageVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"获取视频的指定帧";
    self.view.backgroundColor = [UIColor lightTextColor];
    _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 200)];
    [self.view addSubview:_imageView];
    //
    NSString *path = [[NSBundle mainBundle] pathForResource:@"popeye" ofType:@"mp4"];
    UIImage *image = [AVFoundationTool firstFrameWithVideoURL:[NSURL fileURLWithPath:path] size:CGSizeMake(UIScreen.mainScreen.bounds.size.width, 200)];
    self.imageView.image = image;
}

@end
